/*
* Copyright (c) DESIGN inc. All Rights Reserved.
* http://www.design-inc.jp/
*
*/
jQuery(function($){
// liとtrの奇数・偶数・最初・最後にクラス付与(odd, even, first, last)
$('li:nth-child(odd), tr:nth-child(odd)').addClass('odd');
$('li:nth-child(even), tr:nth-child(even)').addClass('even');
$('li:first-child, tr:first-child').addClass('first');
$('li:last-child, tr:last-child').addClass('last');
// ページ内スクロール
$('a.scroll').click(function(){
$('html,body').animate({scrollTop: $($(this).attr('href')).offset().top }, {'duration': 400, 'easing': 'easeOutCubic', 'queue': false});
return false;
});
// 外部リンクに「target="_blank"」付与(クラス「a.noblank以外」)
$('a[href^=http]').not('[href*="'+location.hostname+'"]').not('a.noblank').attr('target', '_blank');
// jquery.rollOver.js
$.fn.rollOver({
selectorFade: '.ro-fade img, .ro-fade input, a[rel$="shadowbox"] img',
animateTime: 300,
fadeOpacity: 0.7,
easing: 'easeOutCubic'
});
// fixHeight.js
$('.fixHeight').fixHeight();
// .page-title
$('.page-title').prependTo('#content-inner').show();
// パンクズ
$('.bread').prependTo('.page-title').show();
// blog-calendar取得
$('#blog-calendar').load($('#blog-calendar').attr('title'));
// blog-calendar切替
$('#blog-calendar .calendar-head a').live('click', function(){
$('#blog-calendar').load($(this).attr('href'));
return false;
});
// Googleマップを.googlemapに挿入
// カスタマイズこちらを参照(http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html)
if($('.googlemap').length){
var lat = '36.159195';
var lng = '139.27941';
if (lat && lng) {
var latlng = new google.maps.LatLng(lat, lng);
var mapOptions = {
zoom: 12,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
panControl: false, // 移動コントロール
zoomControl: false, // ズームコントロール
mapTypeControl: true, // マップタイプ
scaleControl: false, // スケール
streetViewControl: false // ストリートビューペグマン
};
$('.googlemap').each(function(i){
var map = new google.maps.Map($('.googlemap').get(i), mapOptions);
var marker = new google.maps.Marker({map: map, position: latlng});
var styleOptions = [{
featureType: 'all', // all, road, road.local, etc...
elementType: 'labels', // all, labels, geometry, geometry.fill, etc…
stylers: [
{visibility: 'on'} // 表示(on, simplified, off)
]
}, {
featureType: 'all',
elementType: 'geometry',
stylers: [
{visibility: 'on'}, // 表示(on, simplified, off)
{saturation: '0'}, // 彩度(-100~100)
{lightness: '0'}, // 明度(-100~100)
{gamma: '1.0'} // ガンマ(0.01~10.0)
]
}];
var lopanType = new google.maps.StyledMapType(styleOptions);
map.mapTypes.set('noText', lopanType);
map.setMapTypeId('noText');
});
} else {
$('.googlemap').remove();
}
}
// PCサイトのフッターにスマホサイトへのリンク
var userAgent = navigator.userAgent;
if ((userAgent.indexOf('iPhone') > 0 && userAgent.indexOf('iPad') == -1) || userAgent.indexOf('iPod') > 0 || userAgent.indexOf('Android') > 0 ) {
$('body').append('');
}
});